home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / Dialogs.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  24.5 KB  |  839 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dialogs.a
  3. ;
  4. ;    Contains:    Dialog Manager interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  18. __DIALOGS__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  24.     include 'MixedMode.a'
  25.     ENDIF
  26.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  27.     include 'Events.a'
  28.     ENDIF
  29.     IF &TYPE('__MACWINDOWS__') = 'UNDEFINED' THEN
  30.     include 'MacWindows.a'
  31.     ENDIF
  32.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  33.     include 'TextEdit.a'
  34.     ENDIF
  35.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  36.     include 'Controls.a'
  37.     ENDIF
  38.  
  39.  
  40.                                                             ; errors & gestalt
  41. gestaltDialogMgrAttr            EQU        'dlog'
  42. gestaltDialogMgrPresent            EQU        $00000001
  43. dialogNoTimeoutErr                EQU        -5640
  44.  
  45.  
  46.                                                             ; new, more standard names for dialog item types
  47. kControlDialogItem                EQU        4
  48. kButtonDialogItem                EQU        4
  49. kCheckBoxDialogItem                EQU        5
  50. kRadioButtonDialogItem            EQU        6
  51. kResourceControlDialogItem        EQU        7
  52. kStaticTextDialogItem            EQU        8
  53. kEditTextDialogItem                EQU        16
  54. kIconDialogItem                    EQU        32
  55. kPictureDialogItem                EQU        64
  56. kUserDialogItem                    EQU        0
  57. kItemDisableBit                    EQU        128
  58.  
  59.                                                             ; old names for dialog item types
  60. ctrlItem                        EQU        4
  61. btnCtrl                            EQU        0
  62. chkCtrl                            EQU        1
  63. radCtrl                            EQU        2
  64. resCtrl                            EQU        3
  65. statText                        EQU        8
  66. editText                        EQU        16
  67. iconItem                        EQU        32
  68. picItem                            EQU        64
  69. userItem                        EQU        0
  70. itemDisable                        EQU        128
  71.  
  72.                                                             ; standard dialog item numbers
  73. kStdOkItemIndex                    EQU        1
  74. kStdCancelItemIndex                EQU        2                    ; old names
  75. ok                                EQU        1
  76. cancel                            EQU        2
  77.  
  78.                                                             ; standard icon resource id's     
  79. kStopIcon                        EQU        0
  80. kNoteIcon                        EQU        1
  81. kCautionIcon                    EQU        2                    ; old names
  82. stopIcon                        EQU        0
  83. noteIcon                        EQU        1
  84. cautionIcon                        EQU        2
  85.  
  86.  
  87.  
  88.     IF OLDROUTINENAMES THEN
  89.  
  90. ;   These constants lived briefly on ETO 16.  They suggest
  91. ;   that there is only one index you can use for the OK 
  92. ;   item, which is not true.  You can put the ok item 
  93. ;   anywhere you want in the DITL.
  94.  
  95.  
  96.  
  97. kOkItemIndex                    EQU        1
  98. kCancelItemIndex                EQU        2
  99.     ENDIF    ; OLDROUTINENAMES
  100. ;     Dialog Item List Manipulation Constants    
  101. ; typedef SInt16                         DITLMethod
  102.  
  103.  
  104. overlayDITL                        EQU        0
  105. appendDITLRight                    EQU        1
  106. appendDITLBottom                EQU        2
  107. ; typedef SInt16                         StageList
  108.  
  109. ;  DialogRef is obsolete. Use DialogPtr instead.
  110. ; typedef DialogPtr                     DialogRef
  111.  
  112. DialogRecord            RECORD 0
  113. window                     ds        WindowRecord    ; offset: $0 (0)
  114. items                     ds.l    1                ; offset: $9C (156)
  115. textH                     ds.l    1                ; offset: $A0 (160)
  116. editField                 ds.w    1                ; offset: $A4 (164)
  117. editOpen                 ds.w    1                ; offset: $A6 (166)
  118. aDefItem                 ds.w    1                ; offset: $A8 (168)
  119. sizeof                     EQU *                    ; size:   $AA (170)
  120.                         ENDR
  121. ; typedef struct DialogRecord *            DialogPeek
  122.  
  123. DialogTemplate            RECORD 0
  124. boundsRect                 ds        Rect            ; offset: $0 (0)
  125. procID                     ds.w    1                ; offset: $8 (8)
  126. visible                     ds.b    1                ; offset: $A (10)
  127. filler1                     ds.b    1                ; offset: $B (11)
  128. goAwayFlag                 ds.b    1                ; offset: $C (12)
  129. filler2                     ds.b    1                ; offset: $D (13)
  130. refCon                     ds.l    1                ; offset: $E (14)
  131. itemsID                     ds.w    1                ; offset: $12 (18)
  132. title                     ds        Str255            ; offset: $14 (20)
  133. sizeof                     EQU *                    ; size:   $114 (276)
  134.                         ENDR
  135. ; typedef struct DialogTemplate *        DialogTPtr
  136.  
  137. ; typedef DialogTPtr *                    DialogTHndl
  138.  
  139. AlertTemplate            RECORD 0
  140. boundsRect                 ds        Rect            ; offset: $0 (0)
  141. itemsID                     ds.w    1                ; offset: $8 (8)
  142. stages                     ds.w    1                ; offset: $A (10)
  143. sizeof                     EQU *                    ; size:   $C (12)
  144.                         ENDR
  145. ; typedef struct AlertTemplate *        AlertTPtr
  146.  
  147. ; typedef AlertTPtr *                    AlertTHndl
  148.  
  149. ;  new type abstractions for the dialog manager 
  150. ; typedef SInt16                         DialogItemIndexZeroBased
  151.  
  152. ; typedef SInt16                         DialogItemIndex
  153.  
  154. ; typedef SInt16                         DialogItemType
  155.  
  156. ;  dialog manager callbacks 
  157.  
  158.     IF ¬ TARGET_OS_MAC THEN
  159. ;  QuickTime 3.0 
  160. ;
  161. ; pascal void SetModelessDialogCallbackProc(DialogPtr theDialog, QTModelessCallbackProcPtr callbackProc)
  162. ;
  163.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  164.         IMPORT_CFM_FUNCTION SetModelessDialogCallbackProc
  165.     ENDIF
  166.  
  167. ;
  168. ; pascal OSErr GetDialogControlNotificationProc(void *theProc)
  169. ;
  170.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  171.         IMPORT_CFM_FUNCTION GetDialogControlNotificationProc
  172.     ENDIF
  173.  
  174. ;
  175. ; pascal void SetDialogMovableModal(DialogPtr theDialog)
  176. ;
  177.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  178.         IMPORT_CFM_FUNCTION SetDialogMovableModal
  179.     ENDIF
  180.  
  181. ;
  182. ; pascal void *GetDialogParent(DialogPtr theDialog)
  183. ;
  184.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  185.         IMPORT_CFM_FUNCTION GetDialogParent
  186.     ENDIF
  187.  
  188.     ENDIF
  189.  
  190. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  191. ;      • Following types are valid with Appearance 1.0 and later
  192. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  193.  
  194.  
  195.  
  196.                                                             ; Alert types to pass into StandardAlert 
  197. kAlertStopAlert                    EQU        0
  198. kAlertNoteAlert                    EQU        1
  199. kAlertCautionAlert                EQU        2
  200. kAlertPlainAlert                EQU        3
  201. ; typedef SInt16                         AlertType
  202.  
  203.  
  204. kAlertDefaultOKText                EQU        -1                    ; "OK"
  205. kAlertDefaultCancelText            EQU        -1                    ; "Cancel"
  206. kAlertDefaultOtherText            EQU        -1                    ; "Don't Save"
  207. ;  StandardAlert alert button numbers 
  208.  
  209. kAlertStdAlertOKButton            EQU        1
  210. kAlertStdAlertCancelButton        EQU        2
  211. kAlertStdAlertOtherButton        EQU        3
  212. kAlertStdAlertHelpButton        EQU        4
  213.  
  214.                                                             ; Dialog Flags for use in NewFeaturesDialog or dlgx resource 
  215. kDialogFlagsUseThemeBackground    EQU        $01
  216. kDialogFlagsUseControlHierarchy    EQU        $02
  217. kDialogFlagsHandleMovableModal    EQU        $04
  218. kDialogFlagsUseThemeControls    EQU        $08
  219.  
  220.                                                             ; Alert Flags for use in alrx resource 
  221. kAlertFlagsUseThemeBackground    EQU        $01
  222. kAlertFlagsUseControlHierarchy    EQU        $02
  223. kAlertFlagsAlertIsMovable        EQU        $04
  224. kAlertFlagsUseThemeControls        EQU        $08
  225. ;  For dftb resource 
  226.  
  227. kDialogFontNoFontStyle            EQU        0
  228. kDialogFontUseFontMask            EQU        $0001
  229. kDialogFontUseFaceMask            EQU        $0002
  230. kDialogFontUseSizeMask            EQU        $0004
  231. kDialogFontUseForeColorMask        EQU        $0008
  232. kDialogFontUseBackColorMask        EQU        $0010
  233. kDialogFontUseModeMask            EQU        $0020
  234. kDialogFontUseJustMask            EQU        $0040
  235. kDialogFontUseAllMask            EQU        $00FF
  236. kDialogFontAddFontSizeMask        EQU        $0100
  237. kDialogFontUseFontNameMask        EQU        $0200
  238. kDialogFontAddToMetaFontMask    EQU        $0400
  239. AlertStdAlertParamRec    RECORD 0
  240. movable                     ds.b    1                ; offset: $0 (0)        ;  Make alert movable modal 
  241. helpButton                 ds.b    1                ; offset: $1 (1)        ;  Is there a help button? 
  242. filterProc                 ds.l    1                ; offset: $2 (2)        ;  Event filter 
  243. defaultText                 ds.l    1                ; offset: $6 (6)        ;  Text for button in OK position 
  244. cancelText                 ds.l    1                ; offset: $A (10)        ;  Text for button in cancel position 
  245. otherText                 ds.l    1                ; offset: $E (14)        ;  Text for button in left position 
  246. defaultButton             ds.w    1                ; offset: $12 (18)        ;  Which button behaves as the default 
  247. cancelButton             ds.w    1                ; offset: $14 (20)        ;  Which one behaves as cancel (can be 0) 
  248. position                 ds.w    1                ; offset: $16 (22)        ;  Position (kWindowDefaultPosition in this case 
  249. ;  equals kWindowAlertPositionParentWindowScreen) 
  250. sizeof                     EQU *                    ; size:   $18 (24)
  251.                         ENDR
  252. ; typedef struct AlertStdAlertParamRec * AlertStdAlertParamPtr
  253.  
  254. ;  ——— end Appearance 1.0 or later stuff
  255.  
  256.  
  257.  
  258.  
  259.  
  260. ;    NOTE: Code running under MultiFinder or System 7.0 or newer
  261. ;    should always pass NULL to InitDialogs.
  262. ;
  263.  
  264. ;
  265. ; pascal void InitDialogs(void *ignored)
  266. ;
  267.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  268.         _InitDialogs:    OPWORD    $A97B
  269.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION InitDialogs
  271.     ENDIF
  272.  
  273. ;
  274. ; pascal void ErrorSound(SoundUPP soundProc)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  277.         _ErrorSound:    OPWORD    $A98C
  278.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  279.         IMPORT_CFM_FUNCTION ErrorSound
  280.     ENDIF
  281.  
  282. ;
  283. ; pascal DialogPtr NewDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle items)
  284. ;
  285.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  286.         _NewDialog:    OPWORD    $A97D
  287.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  288.         IMPORT_CFM_FUNCTION NewDialog
  289.     ENDIF
  290.  
  291. ;
  292. ; pascal DialogPtr GetNewDialog(SInt16 dialogID, void *dStorage, WindowPtr behind)
  293. ;
  294.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  295.         _GetNewDialog:    OPWORD    $A97C
  296.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  297.         IMPORT_CFM_FUNCTION GetNewDialog
  298.     ENDIF
  299.  
  300. ;
  301. ; pascal DialogPtr NewColorDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle items)
  302. ;
  303.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  304.         _NewColorDialog:    OPWORD    $AA4B
  305.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  306.         IMPORT_CFM_FUNCTION NewColorDialog
  307.     ENDIF
  308.  
  309. ;
  310. ; pascal void CloseDialog(DialogPtr theDialog)
  311. ;
  312.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  313.         _CloseDialog:    OPWORD    $A982
  314.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  315.         IMPORT_CFM_FUNCTION CloseDialog
  316.     ENDIF
  317.  
  318. ;
  319. ; pascal void DisposeDialog(DialogPtr theDialog)
  320. ;
  321.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  322.         _DisposeDialog:    OPWORD    $A983
  323.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  324.         IMPORT_CFM_FUNCTION DisposeDialog
  325.     ENDIF
  326.  
  327. ;
  328. ; pascal void ModalDialog(ModalFilterUPP modalFilter, DialogItemIndex *itemHit)
  329. ;
  330.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  331.         _ModalDialog:    OPWORD    $A991
  332.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  333.         IMPORT_CFM_FUNCTION ModalDialog
  334.     ENDIF
  335.  
  336. ;
  337. ; pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  338. ;
  339.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  340.         _IsDialogEvent:    OPWORD    $A97F
  341.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  342.         IMPORT_CFM_FUNCTION IsDialogEvent
  343.     ENDIF
  344.  
  345. ;
  346. ; pascal Boolean DialogSelect(const EventRecord *theEvent, DialogPtr *theDialog, DialogItemIndex *itemHit)
  347. ;
  348.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  349.         _DialogSelect:    OPWORD    $A980
  350.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  351.         IMPORT_CFM_FUNCTION DialogSelect
  352.     ENDIF
  353.  
  354. ;
  355. ; pascal void DrawDialog(DialogPtr theDialog)
  356. ;
  357.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  358.         _DrawDialog:    OPWORD    $A981
  359.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  360.         IMPORT_CFM_FUNCTION DrawDialog
  361.     ENDIF
  362.  
  363. ;
  364. ; pascal void UpdateDialog(DialogPtr theDialog, RgnHandle updateRgn)
  365. ;
  366.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  367.         _UpdateDialog:    OPWORD    $A978
  368.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  369.         IMPORT_CFM_FUNCTION UpdateDialog
  370.     ENDIF
  371.  
  372. ;
  373. ; pascal void HideDialogItem(DialogPtr theDialog, DialogItemIndex itemNo)
  374. ;
  375.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  376.         _HideDialogItem:    OPWORD    $A827
  377.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  378.         IMPORT_CFM_FUNCTION HideDialogItem
  379.     ENDIF
  380.  
  381. ;
  382. ; pascal void ShowDialogItem(DialogPtr theDialog, DialogItemIndex itemNo)
  383. ;
  384.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  385.         _ShowDialogItem:    OPWORD    $A828
  386.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  387.         IMPORT_CFM_FUNCTION ShowDialogItem
  388.     ENDIF
  389.  
  390. ;
  391. ; pascal DialogItemIndexZeroBased FindDialogItem(DialogPtr theDialog, Point thePt)
  392. ;
  393.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  394.         _FindDialogItem:    OPWORD    $A984
  395.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  396.         IMPORT_CFM_FUNCTION FindDialogItem
  397.     ENDIF
  398.  
  399. ;
  400. ; pascal DialogItemIndex Alert(SInt16 alertID, ModalFilterUPP modalFilter)
  401. ;
  402.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  403.         _Alert:    OPWORD    $A985
  404.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  405.         IMPORT_CFM_FUNCTION Alert
  406.     ENDIF
  407.  
  408. ;
  409. ; pascal DialogItemIndex StopAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  410. ;
  411.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  412.         _StopAlert:    OPWORD    $A986
  413.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  414.         IMPORT_CFM_FUNCTION StopAlert
  415.     ENDIF
  416.  
  417. ;
  418. ; pascal DialogItemIndex NoteAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  419. ;
  420.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  421.         _NoteAlert:    OPWORD    $A987
  422.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  423.         IMPORT_CFM_FUNCTION NoteAlert
  424.     ENDIF
  425.  
  426. ;
  427. ; pascal DialogItemIndex CautionAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  428. ;
  429.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  430.         _CautionAlert:    OPWORD    $A988
  431.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  432.         IMPORT_CFM_FUNCTION CautionAlert
  433.     ENDIF
  434.  
  435. ;
  436. ; pascal void GetDialogItem(DialogPtr theDialog, DialogItemIndex itemNo, DialogItemType *itemType, Handle *item, Rect *box)
  437. ;
  438.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  439.         _GetDialogItem:    OPWORD    $A98D
  440.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  441.         IMPORT_CFM_FUNCTION GetDialogItem
  442.     ENDIF
  443.  
  444. ;
  445. ; pascal void SetDialogItem(DialogPtr theDialog, DialogItemIndex itemNo, DialogItemType itemType, Handle item, const Rect *box)
  446. ;
  447.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  448.         _SetDialogItem:    OPWORD    $A98E
  449.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  450.         IMPORT_CFM_FUNCTION SetDialogItem
  451.     ENDIF
  452.  
  453. ;
  454. ; pascal void ParamText(ConstStr255Param param0, ConstStr255Param param1, ConstStr255Param param2, ConstStr255Param param3)
  455. ;
  456.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  457.         _ParamText:    OPWORD    $A98B
  458.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  459.         IMPORT_CFM_FUNCTION ParamText
  460.     ENDIF
  461.  
  462. ;
  463. ; pascal void SelectDialogItemText(DialogPtr theDialog, DialogItemIndex itemNo, SInt16 strtSel, SInt16 endSel)
  464. ;
  465.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  466.         _SelectDialogItemText:    OPWORD    $A97E
  467.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  468.         IMPORT_CFM_FUNCTION SelectDialogItemText
  469.     ENDIF
  470.  
  471. ;
  472. ; pascal void GetDialogItemText(Handle item, Str255 text)
  473. ;
  474.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  475.         _GetDialogItemText:    OPWORD    $A990
  476.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  477.         IMPORT_CFM_FUNCTION GetDialogItemText
  478.     ENDIF
  479.  
  480. ;
  481. ; pascal void SetDialogItemText(Handle item, ConstStr255Param text)
  482. ;
  483.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  484.         _SetDialogItemText:    OPWORD    $A98F
  485.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  486.         IMPORT_CFM_FUNCTION SetDialogItemText
  487.     ENDIF
  488.  
  489. ;
  490. ; pascal SInt16 GetAlertStage(void)
  491. ;
  492.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  493.         Macro
  494.         _GetAlertStage        &dest=(sp)
  495.             move.w            $0A9A,&dest
  496.         EndM
  497.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  498.         IMPORT_CFM_FUNCTION GetAlertStage
  499.     ENDIF
  500.  
  501. ;
  502. ; pascal void SetDialogFont(SInt16 fontNum)
  503. ;
  504.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  505.         Macro
  506.         _SetDialogFont        &src=(sp)+
  507.             move.w            &src,$0AFA
  508.         EndM
  509.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  510.         IMPORT_CFM_FUNCTION SetDialogFont
  511.     ENDIF
  512.  
  513. ;
  514. ; pascal void ResetAlertStage(void )
  515. ;
  516.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  517.         Macro
  518.         _ResetAlertStage
  519.             clr.w               $0A9A
  520.         EndM
  521.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  522.         IMPORT_CFM_FUNCTION ResetAlertStage
  523.     ENDIF
  524.  
  525.  
  526. ;
  527. ; pascal void AppendDITL(DialogPtr theDialog, Handle theHandle, DITLMethod method)
  528. ;
  529.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  530.         IMPORT_CFM_FUNCTION AppendDITL
  531.     ENDIF
  532.  
  533. ;
  534. ; pascal DialogItemIndex CountDITL(DialogPtr theDialog)
  535. ;
  536.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  537.         IMPORT_CFM_FUNCTION CountDITL
  538.     ENDIF
  539.  
  540. ;
  541. ; pascal void ShortenDITL(DialogPtr theDialog, DialogItemIndex numberItems)
  542. ;
  543.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  544.         IMPORT_CFM_FUNCTION ShortenDITL
  545.     ENDIF
  546.  
  547. ;
  548. ; pascal OSErr GetStdFilterProc(ModalFilterUPP *theProc)
  549. ;
  550.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  551.         Macro
  552.         _GetStdFilterProc
  553.             move.w              #$0203,D0
  554.             dc.w                $AA68
  555.         EndM
  556.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  557.         IMPORT_CFM_FUNCTION GetStdFilterProc
  558.     ENDIF
  559.  
  560. ;
  561. ; pascal OSErr SetDialogDefaultItem(DialogPtr theDialog, DialogItemIndex newItem)
  562. ;
  563.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  564.         Macro
  565.         _SetDialogDefaultItem
  566.             move.w              #$0304,D0
  567.             dc.w                $AA68
  568.         EndM
  569.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  570.         IMPORT_CFM_FUNCTION SetDialogDefaultItem
  571.     ENDIF
  572.  
  573. ;
  574. ; pascal OSErr SetDialogCancelItem(DialogPtr theDialog, DialogItemIndex newItem)
  575. ;
  576.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  577.         Macro
  578.         _SetDialogCancelItem
  579.             move.w              #$0305,D0
  580.             dc.w                $AA68
  581.         EndM
  582.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  583.         IMPORT_CFM_FUNCTION SetDialogCancelItem
  584.     ENDIF
  585.  
  586. ;
  587. ; pascal OSErr SetDialogTracksCursor(DialogPtr theDialog, Boolean tracks)
  588. ;
  589.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  590.         Macro
  591.         _SetDialogTracksCursor
  592.             move.w              #$0306,D0
  593.             dc.w                $AA68
  594.         EndM
  595.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  596.         IMPORT_CFM_FUNCTION SetDialogTracksCursor
  597.     ENDIF
  598.  
  599.  
  600.  
  601.  
  602. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  603. ;      • Appearance Dialog Routines (available only with Appearance 1.0 and later)
  604. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  605.  
  606.  
  607.  
  608. ;
  609. ; pascal DialogPtr NewFeaturesDialog(void *inStorage, const Rect *inBoundsRect, ConstStr255Param inTitle, Boolean inIsVisible, SInt16 inProcID, WindowPtr inBehind, Boolean inGoAwayFlag, SInt32 inRefCon, Handle inItemListHandle, UInt32 inFlags)
  610. ;
  611.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  612.         Macro
  613.         _NewFeaturesDialog
  614.             move.w              #$110C,D0
  615.             dc.w                $AA68
  616.         EndM
  617.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  618.         IMPORT_CFM_FUNCTION NewFeaturesDialog
  619.     ENDIF
  620.  
  621. ;
  622. ; pascal OSErr AutoSizeDialog(DialogPtr inDialog)
  623. ;
  624.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  625.         Macro
  626.         _AutoSizeDialog
  627.             move.w              #$020D,D0
  628.             dc.w                $AA68
  629.         EndM
  630.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  631.         IMPORT_CFM_FUNCTION AutoSizeDialog
  632.     ENDIF
  633.  
  634. ;
  635. ; pascal OSErr StandardAlert(AlertType inAlertType, StringPtr inError, StringPtr inExplanation, AlertStdAlertParamPtr inAlertParam, SInt16 *outItemHit)
  636. ;
  637.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  638.         Macro
  639.         _StandardAlert
  640.             move.w              #$090E,D0
  641.             dc.w                $AA68
  642.         EndM
  643.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  644.         IMPORT_CFM_FUNCTION StandardAlert
  645.     ENDIF
  646.  
  647. ;
  648. ; pascal OSErr GetDialogItemAsControl(DialogPtr inDialog, SInt16 inItemNo, ControlHandle *outControl)
  649. ;
  650.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  651.         Macro
  652.         _GetDialogItemAsControl
  653.             move.w              #$050F,D0
  654.             dc.w                $AA68
  655.         EndM
  656.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  657.         IMPORT_CFM_FUNCTION GetDialogItemAsControl
  658.     ENDIF
  659.  
  660. ;
  661. ; pascal OSErr MoveDialogItem(DialogPtr inDialog, SInt16 inItemNo, SInt16 inHoriz, SInt16 inVert)
  662. ;
  663.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  664.         Macro
  665.         _MoveDialogItem
  666.             move.w              #$0510,D0
  667.             dc.w                $AA68
  668.         EndM
  669.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  670.         IMPORT_CFM_FUNCTION MoveDialogItem
  671.     ENDIF
  672.  
  673. ;
  674. ; pascal OSErr SizeDialogItem(DialogPtr inDialog, SInt16 inItemNo, SInt16 inWidth, SInt16 inHeight)
  675. ;
  676.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  677.         Macro
  678.         _SizeDialogItem
  679.             move.w              #$0511,D0
  680.             dc.w                $AA68
  681.         EndM
  682.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  683.         IMPORT_CFM_FUNCTION SizeDialogItem
  684.     ENDIF
  685.  
  686. ;
  687. ; pascal OSErr AppendDialogItemList(DialogPtr dialog, SInt16 ditlID, DITLMethod method)
  688. ;
  689.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  690.         Macro
  691.         _AppendDialogItemList
  692.             move.w              #$0412,D0
  693.             dc.w                $AA68
  694.         EndM
  695.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  696.         IMPORT_CFM_FUNCTION AppendDialogItemList
  697.     ENDIF
  698.  
  699.  
  700. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  701. ;      • Dialog Routines available only with Appearance 1.1 and later
  702. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  703.  
  704.  
  705.  
  706. ;
  707. ; pascal OSStatus SetDialogTimeout(DialogPtr inDialog, SInt16 inButtonToPress, UInt32 inSecondsToWait)
  708. ;
  709.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  710.         IMPORT_CFM_FUNCTION SetDialogTimeout
  711.     ENDIF
  712.  
  713. ;
  714. ; pascal OSStatus GetDialogTimeout(DialogPtr inDialog, SInt16 *outButtonToPress, UInt32 *outSecondsToWait, UInt32 *outSecondsRemaining)
  715. ;
  716.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  717.         IMPORT_CFM_FUNCTION GetDialogTimeout
  718.     ENDIF
  719.  
  720. ;
  721. ; pascal OSStatus SetModalDialogEventMask(DialogPtr inDialog, EventMask inMask)
  722. ;
  723.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  724.         IMPORT_CFM_FUNCTION SetModalDialogEventMask
  725.     ENDIF
  726.  
  727. ;
  728. ; pascal OSStatus GetModalDialogEventMask(DialogPtr inDialog, EventMask *outMask)
  729. ;
  730.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  731.         IMPORT_CFM_FUNCTION GetModalDialogEventMask
  732.     ENDIF
  733.  
  734.     IF OLDROUTINENAMES THEN
  735.     ENDIF    ; OLDROUTINENAMES
  736. ;    *****************************************************************************
  737. ;    *                                                                           *
  738. ;    * The conditional STRICT_DIALOGS has been removed from this interface file. *
  739. ;    * The accessor macros to a DialogRecord are no longer necessary.            *
  740. ;    *                                                                           *
  741. ;    * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  742. ;    *                                                                           *
  743. ;    *****************************************************************************
  744. ;
  745. ;    Details:
  746. ;    The original purpose of the STRICT_ conditionals and accessor macros was to
  747. ;    help ease the transition to Copland.  Shared data structures are difficult
  748. ;    to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  749. ;    WindowRecord and other data structures, we would begin the migration to the
  750. ;    discipline wherein system data structures are completely hidden from
  751. ;    applications.
  752. ;    
  753. ;    After many design reviews, we finally concluded that with this sort of
  754. ;    migration, the system could never tell when an application was no longer
  755. ;    peeking at a WindowRecord, and thus the data structure might never become
  756. ;    system owned.  Additionally, there were many other limitations in the
  757. ;    classic toolbox that were begging to be addressed.  The final decision was
  758. ;    to leave the traditional toolbox as a compatibility mode.
  759. ;    
  760. ;    We also decided to use the Handle and Ptr based types in the function
  761. ;    declarations.  For example, NewWindow now returns a WindowPtr rather than a
  762. ;    WindowRef.  The Ref types are still defined in the header files, so all
  763. ;    existing code will still compile exactly as it did before.  There are
  764. ;    several reasons why we chose to do this:
  765. ;    
  766. ;    - The importance of backwards compatibility makes it unfeasible for us to
  767. ;    enforce real opaque references in the implementation anytime in the
  768. ;    foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  769. ;    ControlRef, etc.) in the documentation and header files would always be a
  770. ;    fake veneer of opacity.
  771. ;    
  772. ;    - There exists a significant base of books and sample code that neophyte
  773. ;    Macintosh developers use to learn how to program the Macintosh.  These
  774. ;    books and sample code all use direct data access.  Introducing opaque data
  775. ;    types at this point would confuse neophyte programmers more than it would
  776. ;    help them.
  777. ;    
  778. ;    - Direct data structure access is used by nearly all Macintosh developers. 
  779. ;    Changing the interfaces to reflect a false opacity would not provide any
  780. ;    benefit to these developers.
  781. ;    
  782. ;    - Accessor functions are useful in and of themselves as convenience
  783. ;    functions, without being tied to opaque data types.  We will complete and
  784. ;    document the Windows and Dialogs accessor functions in an upcoming release
  785. ;    of the interfaces.
  786. ;
  787.  
  788.  
  789. ;
  790. ; pascal void CouldDialog(SInt16 dialogID)
  791. ;
  792.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  793.         _CouldDialog:    OPWORD    $A979
  794.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  795.         IMPORT_CFM_FUNCTION CouldDialog
  796.     ENDIF
  797.  
  798. ;
  799. ; pascal void FreeDialog(SInt16 dialogID)
  800. ;
  801.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  802.         _FreeDialog:    OPWORD    $A97A
  803.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  804.         IMPORT_CFM_FUNCTION FreeDialog
  805.     ENDIF
  806.  
  807. ;
  808. ; pascal void CouldAlert(SInt16 alertID)
  809. ;
  810.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  811.         _CouldAlert:    OPWORD    $A989
  812.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  813.         IMPORT_CFM_FUNCTION CouldAlert
  814.     ENDIF
  815.  
  816. ;
  817. ; pascal void FreeAlert(SInt16 alertID)
  818. ;
  819.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  820.         _FreeAlert:    OPWORD    $A98A
  821.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  822.         IMPORT_CFM_FUNCTION FreeAlert
  823.     ENDIF
  824.  
  825.  
  826.  
  827.  
  828.  
  829.     IF ¬ TARGET_OS_MAC THEN
  830.     ENDIF
  831.  
  832.  
  833.  
  834.  
  835.     ENDIF ; __DIALOGS__ 
  836.  
  837.